package cn.iocoder.yudao.module.erp.dal.mysql.business.vip;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.business.vip.vo.VipPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.business.vip.VipDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 客户级别 Mapper
 *
 * @author yy
 */
@Mapper
public interface VipMapper extends BaseMapperX<VipDO> {

    default PageResult<VipDO> selectPage(VipPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<VipDO>()
                .likeIfPresent(VipDO::getName, reqVO.getName())
                .eqIfPresent(VipDO::getDiscount, reqVO.getDiscount())
                .betweenIfPresent(VipDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(VipDO::getId));
    }

}